<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>5.圣杯布局</title>
  <style>
    #header {
      text-align: center;
      width: 100%;
      background-color: #ccc;
    }

    #footer {
      text-align: center;
      width: 100%;
      background-color: #ccc;
    }

    .column {
      float: left;
    }

    #center {
      width: 100%;
      background-color: lightblue;
    }

    #left {
      position: relative;
      left: -200px;
      width: 200px;
      margin-left: -100%;
      background-color: lightcoral;
    }

    #right {
      width: 150px;
      background-color: lightcyan;
      margin-right: -150px;
    }

    .container {
      margin-left: 200px;
      margin-right: 150px;
    }
    /* 手写clearfix */
    .clearfix:after {
      content: '';
      display: table;
      clear: both;
    }
    /* 兼容低版本IE */
    
  </style>
</head>

<body>
  圣杯布局和双飞翼布局的目的：
  1.三栏布局，中间一栏最先加载和渲染（内容最重要）
  2.两侧固定，中间内容随着宽度自适应
  3.一般适用于PC页面
  <!-- 5.圣杯布局 -->
  <div id="header">this is header</div>
  <div class="container clearfix">
    <div id="center" class="column">this is center</div>
    <div id="left" class="column">this is left</div>
    <div id="right" class="column">this is right</div>
  </div>
  <div id="footer">this is footer</div>



</body>

</html>